package com.kit.data.kitopeso.adapter;

import android.annotation.SuppressLint;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.bumptech.glide.Glide;
import com.kit.data.kitopeso.R;
import com.kit.data.kitopeso.base.BaseBindingAdapter1;
import com.kit.data.kitopeso.databinding.KitoCardItemBinding;
import com.kit.data.kitopeso.obj.KitoAccountItem;

import java.util.List;

public class AccountAdapter1 extends BaseBindingAdapter1<KitoAccountItem, KitoCardItemBinding> {


    private boolean isEdit;

    public AccountAdapter1(List<KitoAccountItem> dataList) {
        super(dataList);
    }

    @SuppressLint("SetTextI18n")
    @Override
    protected void bindData(KitoCardItemBinding binding, KitoAccountItem item, int position) {

        Glide.with(binding.tvIcon.getContext()).load(item.getWalletLogo()).placeholder(R.mipmap.logo).into(binding.tvIcon);
        binding.tvTitle.setText(item.getWalletDesc());
        binding.tvPhone.setVisibility(View.VISIBLE);
        binding.tvPhone.setText(item.getWalletMobile());

    }

    @Override
    protected int getItemType(KitoAccountItem item) {
        return 0;
    }

    @Override
    protected KitoCardItemBinding createBinding(LayoutInflater inflater, ViewGroup parent, int viewType) {

        return KitoCardItemBinding.inflate(inflater, parent, false);
    }

    public boolean isEdit() {
        return isEdit;
    }

    public void setEdit(boolean edit) {
        isEdit = edit;
    }


}